/*
 * Implementation of checker "2.4    函数调用开销"
 * Author: Qian Chen
 *
 */
#include <fstream>
#include <iostream>
#include <list>
#include <queue>
#include <sstream>
#include <stack>
#include <string>

// #include "AST/Expr.h"
// #include "AST/AST.h"
#include <clang/AST/AST.h>
#include <clang/AST/ASTConsumer.h>
#include <clang/AST/Expr.h>

#include <clang/AST/RecursiveASTVisitor.h>
#include <clang/AST/RecordLayout.h>
#include <clang/Frontend/ASTConsumers.h>
#include <clang/Frontend/ASTUnit.h>
#include <clang/Tooling/Tooling.h>
#include <llvm/Support/raw_ostream.h>

#include "framework/BasicChecker.h"
#include "framework/Report.h"


using namespace clang;
using namespace llvm;
using namespace clang::driver;
using namespace clang::tooling;
using namespace std;

class FunctionCallChecker : public BasicChecker {
public:
    FunctionCallChecker(ASTResource *resource, ASTManager *manager,
                        CallGraph *call_graph, Config *configure)
            : BasicChecker(resource, manager, call_graph, configure) {};

    void check();

private:
    int param_size;
    int array_size;

    void readConfig();

    void checkAllFunctions();

    void addReport(std::string loc, std::string funcName, std::string dec);
};